package com.mf.controller;

import com.mf.entity.vo.OtherInfoVo;
import com.mf.service.IOtherInfoService;
import io.github.heollhai.common.result.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.*;


/**
 * @author mf
 * @since 2024-09-01
 */
@RestController
@RequestMapping("personnel/otherInfo/v1")
@Tag(name = "其他信息")
public class OtherInfoController {
    @Resource
    private IOtherInfoService otherInfoService;

    @PostMapping("save")
    @Operation(summary = "新增|编辑")
    public Result<Integer> save(@Valid @RequestBody() OtherInfoVo otherInfoVo) {
        return Result.success(otherInfoService.insert(otherInfoVo));
    }

    @Operation(summary = "查询")
    @GetMapping("list")
    public Result<OtherInfoVo> list(@RequestParam("rosterId") Integer rosterId) {
        return Result.success(otherInfoService.getByRosterId(rosterId));
    }
}
